<?php
class User{

    private  $name;

    function  __construct($name)
    {
        $this->name =$name;
    }
    public function  getUserName(){
        return $this->name;
    }

}

interface UserInterface{
       function  getUserName();
}
class  UserInfo implements UserInterface
{
       protected      $user;
       function __construct( $user)
        {
          $this->User =$user;
        }

    public function getUserName()
    {
        return    $this->User->getUserName();
    }
}
$oldUser = new User('lisi');
echo $oldUser->getUserName();


$userInfo=new UserInfo($oldUser);
echo $userInfo->getUserName();